module.exports = {
  // Convert a byte array to a hex string
  bytesToHex: function(bytes) {
    for (var hex = [], i = 0; i < bytes.length; i++) {
      hex.push((bytes[i] >>> 4).toString(16))
      hex.push((bytes[i] & 0xf).toString(16))
    }
    return hex.join('')
  },
  // Convert a hex string to a byte array
  hexToBytes: function(hex) {
    for (var bytes = [], c = 0; c < hex.length; c += 2) {
      bytes.push(parseInt(hex.substr(c, 2), 16))
    }
    return bytes
  }
}
